
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Quản Lý Hóa Đơn</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />
        <script type="text/javascript" src="js/jquery-1.5.2.js"></script>
        <script type="text/javascript" src="js/myJS.js"></script>
        <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>

    </head>
    <body>
         <div id="top-background">
             <div id="page-container">
                 <jsp:include page="template/header.jsp"></jsp:include>
                 <jsp:include page="template/adminpage_menu.jsp"></jsp:include>
                 <div id="main-content">
                     <div style="padding: 10px;">
                          <h2 style="color:#0099ff;">Bộ lọc</h2><br>
                         <s:form action="QLHoaDon" method="POST" cssStyle="padding:0px 10px 10px 0px;" theme="simple">
                             <table>
                                 <tr>
                                     <td>
                                         <h4 style="color:#0099ff;">Tìm kiếm theo</h4>
                                     </td>
                                     <td>
                                         <s:select list="#{'0':'Chưa duyệt','1':'Đã duyệt'}" name="chon"></s:select>
                                     </td>
                                      <td>
                                        <s:submit name="btnTimKiem" value="Tìm kiếm"></s:submit>
                                      </td>
                                 </tr>
                                 
                              
                                 <tr>
                                     <td colspan="2">
                                         <s:actionerror cssStyle="color:red;" />
                                     </td>
                                 </tr>

                             </table>
                         </s:form>
                     </div>
                    
                    
                     <div style="padding: 10px;">
                       <h2 style="color: #0099ff;">Danh sách hóa đơn</h2>
                       <s:iterator value="dshd" status="dshdStatus">
                       <s:form action="CapNhatHD.action?MaHD=%{MaHD}" method="POST" theme="simple">
                         <table width="100%;" border="1" id="khachhang">
                             <tr>
                                 <td>
                                     <p style="color: #0099ff;">Mã hóa đơn</p>
                                 </td>
                                 <td>
                                     <s:property value="maHD" />
                                 </td>
                                 <td>
                                     <p style="color: #0099ff;">Ngày lập hóa đơn</p>
                                 </td>
                                 <td>
                                     <s:property value="ngayLapHD" />
                                 </td>
                                  <td>
                                     <p style="color: #0099ff;">Ngày giao hàng</p>
                                 </td>
                                 <td>
                                     <s:textfield name="NgayGiaoHang" theme="simple" value="%{ngayGiaoHang}"></s:textfield>
                                 </td>
                             </tr>
                              <tr>
                                 <td>
                                     <p style="color: #0099ff;">Họ tên</p>
                                 </td>
                                 <td>
                                      <s:property value="hoTen" />
                                 </td>
                                 <td>
                                     <p style="color: #0099ff;">Địa chỉ giao hàng</p>
                                 </td>
                                 <td>
                                      <s:textfield name="DiaChiGiaoHang" theme="simple" value="%{diachiGiaoHang}"></s:textfield> </td>
                                  <td>
                                     <p style="color: #0099ff;">Trạng thái</p>
                                 </td>
                                 <td>
                                     <s:select value='%{trangThai}' list="#{'0':'Chưa duyệt','1':'Đã duyệt'}" name = "TrangThai" cssStyle="width:142px" theme="simple"/>
                                 </td>
                             </tr>
                            
                             <tr>
                                   <s:url id = "chonhd" action="QLHoaDon">
                                         <s:param name = "GiaTriTim" value="MaHD"></s:param>
                                         <s:param name = "chon" value="chon"></s:param>
                                     </s:url>
                                 <td>
                                       <s:a href="%{chonhd}">Chọn</s:a>
                                 </td>
                                     <s:url id = "xoa" action="XoaHD">
                                         <s:param name = "GiaTriTim" value="MaHD"></s:param>
                                         <s:param name = "chon" value="chon"></s:param>
                                     </s:url>
                                 <td>
                                     <s:a href="%{xoa}">Xóa</s:a>
                                 </td>
                                 <td>
                                     <s:hidden name = "chon" value="%{chon}"></s:hidden>
                                     <s:submit name="btnCapNhat" value="Cập nhật" theme="simple"></s:submit>
                                 </td>
                             </tr>
                             <tr>
                                 <td colspan="6" bgcolor="black" height="10px">

                                 </td>
                             </tr>
                         </table>
                     </s:form>
                     </s:iterator>
                     </div>
                       <div style="padding: 10px;">
                       <h2 style="color: #0099ff;">Chi tiết hóa đơn</h2>
                       <s:iterator value="dscthd" status="dscthdStatus">
                       <s:form action="CapNhatCTHD.action?MaHD=%{MaHD}&MaSP=%{MaSP}" method="POST" theme="simple">
                         <table width="100%;" border="1" id="khachhang">
                             <tr>
                                 <td>
                                     <p style="color: #0099ff;">Mã hóa đơn</p>
                                 </td>
                                 <td>
                                     <s:property value="maHD" />
                                 </td>
                                 <td>
                                     <p style="color: #0099ff;">Tên sản phẩm</p>
                                 </td>
                                 <td>
                                     <s:property value="tenSP" />
                                 </td>
                                  <td>
                                     <p style="color: #0099ff;">Số lượng</p>
                                 </td>
                                 <td>
                                     <s:textfield name="SoLuong" theme="simple" value="%{soLuong}"></s:textfield>
                                 </td>
                             </tr>
                            
                             <tr>
                                     <s:url id = "xoa" action="XoaCTHD">
                                         <s:param name = "GiaTriTim" value="MaHD"></s:param>
                                         <s:param name = "MaSP" value="MaSP"></s:param>
                                         <s:param name = "chon" value="chon"></s:param>
                                     </s:url>
                                 <td>
                                     <s:a href="%{xoa}">Xóa</s:a>
                                 </td>
                                 <td>
                                     <s:hidden name = "chon" value="%{chon}"></s:hidden>
                                     <s:submit name="btnCapNhat" value="Cập nhật" theme="simple"></s:submit>
                                 </td>
                             </tr>
                             <tr>
                                 <td colspan="6" bgcolor="black" height="10px">

                                 </td>
                             </tr>
                         </table>
                     </s:form>
                     </s:iterator>
                     </div>
                 </div>
                 <div style="clear: both;"></div>
                 <jsp:include page="template/footer.jsp"></jsp:include>
             </div>
        </div>
    </body>
</html>
